try {
    $response = Invoke-WebRequest -Uri "http://192.168.43.1/api/" -Method POST -Headers $headers -Body $body
    
    Write-Output "HTTP Status Code: $($response.StatusCode)"
    
    # 尝试直接读取原始响应内容
    $reader = [System.IO.StreamReader]::new($response.RawContentStream, [System.Text.Encoding]::UTF8)
    $rawContent = $reader.ReadToEnd()
    $reader.Close()

    Write-Output "Raw Response Content: $rawContent"
}
catch {
    $errorMsg = $_.Exception.Message
    if ($_.Exception.Response) {
        $streamReader = [System.IO.StreamReader]::new($_.Exception.Response.GetResponseStream())
        $errorResponse = $streamReader.ReadToEnd()
        $streamReader.Close()

        Write-Output "Error Status: $($_.Exception.Response.StatusCode.value__)"
        Write-Output "Error Message: $errorMsg"
        Write-Output "Error Response Body: $errorResponse"
    } else {
        Write-Output "Error Message: $errorMsg"
    }
}
